/**
 * @brief PIR 人体传感器
 */
#pragma once

#include "BridgedDevice.h"

class OccupancySensor final : public BridgedDevice
{
public:
    static constexpr DeviceTypeId kDeviceTypeOccupancySensor = 0x0107;
    explicit OccupancySensor(const BasicInformation* node);

    [[nodiscard]] uint8_t GetMeasuredValue() const { return mMeasurement; }
    void SetMeasuredValue(uint8_t measurement);

    Protocols::InteractionModel::Status ReadAttribute(
        ClusterId clusterId,
        AttributeId attributeId,
        uint8_t* buffer,
        uint16_t maxReadLength) override;

    ChipError OnReport(const DataBlock* block) override;

private:
    uint8_t mMeasurement;
};
